package com.qhit.service.impl;

import com.qhit.dao.RoleMapper;
import com.qhit.pojo.Role;
import com.qhit.service.RoleService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;

@Service
public class RoleServiceImpl implements RoleService {
    @Autowired
    private RoleMapper roleMapper;
    public List<Role> getList(HashMap hashMap) {
        return roleMapper.getList(hashMap);
    }

    public long getListCount(HashMap hashMap) {
        return roleMapper.getListCount(hashMap);
    }

    public int add(Role role) {
        return roleMapper.add(role);
    }

    public Role getRoleById(String id) {
        return roleMapper.getRoleById(id);

    }

    public int edit(Role role) {

        return roleMapper.edit(role);
    }

    public int del(String id) {
        return roleMapper.del(id);
    }

    public List<Role> getRolesByUserId(int id) {

        return roleMapper.getRolesByUserId(id);
    }
}
